1. Field of the Invention
This application relates to microcontroller architecture, and more particularly to a flexible microcontroller which is PC/AT-compatible.
2. Description of the Related Art
When IBM produced its first personal computer, the product was named a xe2x80x9cPC.xe2x80x9d PCs quickly became very popular, and companies started developing hardware and software products to support the PC. By 1984, when IBM announced its PC/AT, a standard by which companies developed PC-based products had been defined.
PC/AT compatibility is a standard with no true specification. Instead, the rapid growth of the personal computer industry around the PC/AT machine helped to define the standard. Manufacturers of PC/AT-compatible computers were unable to change this standard because of the huge installed base of software and hardware built for the original PC. Even IBM was helpless to change a standard they helped to create.
Fifteen years later, PC/AT-compatible computers are still being manufactured and sold. Although somewhat amorphous, the PC/AT compatibility standard may nevertheless be defined according to a few key components. At a software level, PC/AT compatibility implies that a computer is able to run DOS and Windows(copyright). These programs require a computer to include very particular hardware and firmware, however.
First, a main processor, an Intel 8088 or compatible microprocessor, sits at the heart of a PC/AT-compatible system. Essentially, the purpose of the microprocessor is to read instructions from memory and perform the operations specified by the instructions. The operations that may be performed include internal operations such as executing math functions, reading data from external devices, or writing data to external devices.
Thus, to fulfill its purpose, the microprocessor in a computer is typically coupled to a memory and one or more external devices, known as peripheral devices. The coupling of memory and the peripheral devices to the microprocessor is achieved using one or more buses. An ISA bus, short for Industry Standard Architecture, connects one or more peripheral devices to the microprocessor and the memory of a PC/AT-compatible computer.
Other ISA bus features are commonly found in PC/AT computers. The ISA bus supports a 16 Mb memory address space as well as a 1 Mb I/O address space. The ISA bus also supports 8-bit and 16-bit data widths. Further, dynamic sizing of the ISA bus is possible in PC/AT-compatible systems.
In order for the devices to communicate, a computer system includes one or more clock signals. The clock(s) enable the various devices to synchronize to one another so that the devices may properly communicate. Further, in a PC/AT-compatible computer system, a set of interval timers provides a programmable frequency source for hardware and software to exploit.
Coupled to the microprocessor by the ISA or other buses, peripheral devices may from time to time required service from the microprocessor. In a PC/AT-compatible architecture, peripheral devices use interrupt request lines to obtain the attention of the microprocessor. Logic which arbitrates between multiple interrupt requests to the microprocessor in a particular manner is also part of a PC/AT-compatible system.
For transfers between the peripheral devices and the memory, a PC/AT-compatible system includes logic known as direct memory access, or DMA. DMA provides the capability for transfers to be made between peripheral devices and memory while the processor is executing instructions. A PC/AT-compatible system has particular requirements for how DMA channels are configured and organized. For example, the PC/AT supports fly-by DMA transfers only between memory and I/O devices. Memory-to-memory DMA transfers are not supported.
The ISA bus further supports dynamic cycle timing control using a pin known as IOCHRDY. Also, typically by including an ISA connector, DMA channels and IRQs are provided external to the PC/AT-compatible computer, so that external devices may communicate with the microprocessor and memory.
Another feature of PC/AT-compatible systems is the presence of a real-time clock, or RTC, and CMOS, a type of low power memory. The RTC and CMOS RAM are connected to a battery such that when the system is powered down, stored information contained in CMOS is retained.
I/O address mapping is fixed in PC/AT-compatible systems, and some PC/AT cards expect address aliasing because only 10 of the 16 available address bits are decoded. Standard PC/AT peripheral devices are direct-mapped in an I/O space from 0000h to 03FFh.
A PC/AT-compatible system includes a particular mapping of its memory, known commonly as dynamic random access memory, or DRAM. DRAM is typically addressed in a linear fashion staring at 00000000h and ending at the top of DRAM. Such systems also include a read-only memory, or ROM, which typically includes firmware which performs a power-on self test, or POST, when the computer is first turned on. Further, all PC/AT-compatible systems include firmware known as basic input output system or BIOS. (Without the BIOS in the ROM, DOS and Windows(copyright) would not run.) The BIOS provides programs, known as software interrupts, which enable an operating system and application programs to interact with peripheral devices, such as floppy and fixed disk drives, without having to address the hardware directly.
In a PC/AT-compatible system, the BIOS ROMs are mapped over the normal DRAM space. Thus, a windowing mechanism is required to redirect accesses to these spaces out to the ISA bus to access the ROM. Further, to support system management mode (SMM), which is common in many PC/AT computers today, an additional overlay DRAM region, accessible only to the processor, is provided. Additionally, several regions below the top of memory are decoded to support BIOS, expansion ROMs, and a video buffer. To recover these regions, typical PC/AT systems xe2x80x9cshadowxe2x80x9d these regions (i.e., copy the ROM contents to DRAM) for faster execution.
During system initialization, or POST, instructions are executed by the microprocessor. Because PC/AT-compatible systems are flexible enough to permit system expansion, POST typically includes programs to detect when new hardware has been added to the computer. For example, one of the requirements of POST is to determine the size of memory. Because of the vast array of DRAM types and speeds that are commercially available, a PC/AT-compatible system provides a mechanism to allow POST to determine the type of memory which populates the computer.
In addition to the ISA bus, most PC/AT-compatible systems today include a high performance peripheral component interconnect, or PCI, bus. In particular, PCI buses are favored for connecting a video subsystem to the computer. For those PC/AT-compatible systems which implement a PCI bus, a PCI host bridge coupled between the processor bus and the PCI bus maintains a mirror image of the current DRAM size configuration register in order to properly respond to a PCI access. Having this information in the PCI host bridge has permitted targets on the PCI bus to react more quickly to a request.
Briefly, the illustrative system provides a microcontroller with the flexibility to provide a PC/AT-compatible or non-PC/AT-compatible embedded environment. The microcontroller includes an 8088-compatible processor and a processor bus. Coupled to the processor bus, a DRAM controller and a ROM controller provide for external DRAM and ROMs to be connected to the microcontroller.
The microcontroller includes a general purpose bus which may emulate an ISA bus for PC/AT compatibility. Further, the microcontroller includes DMA channels, interrupt controllers, programmable timers, and a flexible I/O mapping scheme, all of which conform to PC/AT compatibility requirements. Further, the microcontroller includes a real-time clock and programmable address mapping.
Several PC/AT peripheral devices are embedded in the microcontroller of the illustrative system. These include 8259-compatible programmable interrupt controllers, or PICs, an 8254-compatible programmable interval timer, and 8237-compatible direct memory access controllers. Certain PICs of the microcontroller are disabled while other PICs are enabled to provide a PC/AT-compatible environment. Further, an MC146818-compatible real-time clock is embedded in the microcontroller.
The flexible memory mapping of the microcontroller facilitates the creation of a system memory map which is PC/AT-compatible. Provisions for DOS xe2x80x9cholesxe2x80x9d for BIOS shadowing and for PCI bus requirements are readily available using this feature.
The microcontroller also provides PC/AT-compatible processor reset function. Further, support for system control ports A and B, NMI generation, A20 gate commands, and DOS-compatible FPU error reporting are possible using this microcontroller. Finally, a dedicated pin is provided for connection to an external clock if so desired. The microcontroller can be configured for a PC/AT-compatible mode or a non-PC/AT-compatible mode.